package com.koron.system.unityUser.feign;

import com.koron.common.core.feignConfig.FeignFallbackFactory;
import com.koron.system.unityUser.entity.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * description: UnityFeignService
 *
 * @author huangsj
 * @date 2023/6/29 15:49
 */
@FeignClient(name = "UUMSWS",url = "http://zsj.guangdongwater.com:9082/UUMSWS/WS",fallbackFactory = FeignFallbackFactory.class)
public interface UnityFeignService {
    /**
     * WS用户登录
     *
     * @param auth
     * @param arg1
     * @param arg2
     * @return
     */
    @GetMapping("/rest/uumsws/hello")
    WsResult<String> hello(@RequestParam(required = false,value = "auth") String auth,
                           @RequestParam(value = "arg1") String arg1,
                           @RequestParam(value = "arg2") String arg2);

    /**
     * 标段类型字典
     *
     * @param auth
     * @return
     */
    @GetMapping("/rest/uumsws/bidTypeDictionary")
    WsResultList<UumsBidType> bidTypeDictionary(@RequestParam(value = "auth") String auth);

    /**
     * 机构类型字典
     *
     * @param auth
     * @return
     */
    @GetMapping("/rest/uumsws/organizationTypeDictionary")
    WsResultList<UumsOrganizationType> organizationTypeDictionary(@RequestParam(value = "auth") String auth);

    /**
     * 系统状态字典
     *
     * @param auth
     * @return
     */
    @GetMapping("/rest/uumsws/appStateDictionary")
    WsResultList<UumsAppState> appStateDictionary(@RequestParam(value = "auth")String auth);

    /**
     * 珠三角工程信息
     *
     * @param auth
     * @return
     */
    @GetMapping("/rest/uumsws/project")
    WsResult<UumsProject> project(@RequestParam(value = "auth") String auth);

    /**
     * 组织机构信息
     *
     * @param auth
     * @param orgCode
     * @return
     */
    @GetMapping("/rest/uumsws/organizationList")
    WsResultList<UumsOrganization> organizationList(@RequestParam(value = "auth") String auth,
                                                    @RequestParam(required = false,value = "orgCode") String orgCode);

    /**
     * 公司信息
     *
     * @param auth
     * @param companyCode
     * @return
     */
    @GetMapping("/rest/uumsws/companyList")
    WsResultList<UumsCompany> companyListcompanyList(@RequestParam(value = "auth") String auth,
                                                     @RequestParam(required = false,value = "companyCode") String companyCode);

    /**
     * 标段信息
     *
     * @param auth
     * @param bidCode
     * @return
     */
    @GetMapping("/rest/uumsws/bidList")
    WsResultList<UumsBid> bidListbidList(@RequestParam(value = "auth") String auth,
                                         @RequestParam(required = false,value = "bidCode") String bidCode);

    /**
     * 子系统信息
     *
     * @param auth
     * @param appCode
     * @return
     */
    @GetMapping("/rest/uumsws/appList")
    WsResultList<UumsApp> appList(@RequestParam(value = "auth") String auth,
                                  @RequestParam(required = false,value = "appCode") String appCode);

    /**
     * 通过ID查询用户授权信息
     *
     * @param auth
     * @param uumsUserId
     * @return
     */
    @GetMapping("/rest/uumsws/appListByUserId")
    WsResultList<UumsApp> appListByUserId(@RequestParam(value = "auth") String auth,
                                          @RequestParam(value = "uumsUserId") String uumsUserId);

    /**
     * 通过ID查询用户信息
     *
     * @param auth
     * @param uumsUserId
     * @return
     */
    @GetMapping("/rest/uumsws/UserById")
    WsResult<UumsUser> UserById(@RequestParam(value = "auth") String auth,
                                @RequestParam(value = "uumsUserId") String uumsUserId);

    /**
     * 通过用户名密码查询用户信息
     *
     * @param auth
     * @param lnm
     * @param pw
     * @return
     */
    @GetMapping("/rest/uumsws/UserByLNmPw")
    WsResultUumsUser UserByLNmPw(@RequestParam(value = "auth") String auth,
                                 @RequestParam(value = "lnm") String lnm,
                                 @RequestParam(value = "pw") String pw);

    /**
     * 通过公司编码、组织机构编码、系统编码查询用户信息
     *
     * @param auth
     * @param companyCode
     * @param organizationCode
     * @param appCode
     * @return
     */
    @GetMapping("/rest/uumsws/UserList")
    WsResultList<UumsUser> UserList(@RequestParam(value = "auth") String auth,
                                    @RequestParam(required = false,value = "companyCode") String companyCode,
                                    @RequestParam(required = false,value = "organizationCode") String organizationCode,
                                    @RequestParam(required = false,value = "appCode") String appCode);

    /**
     * 修改用户密码
     *
     * @param auth
     * @param userId
     * @param oldPs
     * @param newPs1
     * @param newPs2
     * @return
     */
    @GetMapping("/rest/uumsws/changePassword")
    WsResult<Integer> changePassword(@RequestParam(value = "auth") String auth,
                                     @RequestParam(value = "userId") String userId,
                                     @RequestParam(value = "oldPs") String oldPs,
                                     @RequestParam(value = "newPs1") String newPs1,
                                     @RequestParam(value = "newPs2") String newPs2);
}
